#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
    vector<int> countBits(int n) {
        vector<int> ret;
        for (int i = 0; i <= n; i++)
        {
            int count = 0, k = i;
            while (k)
            {
                count++;
                k &= (k - 1);
            }
            ret.push_back(count);
        }
        return ret;
    }
};

int main()
{
    return 0;
}